package simulation;

/**
 * Authors: Ben Lee, Kyle Martin, Ross Hadden
 * Purpose: A Plane is an event where a plane takes off or lands.  It stores both the current
 * and original scheduled times because a player cannot make a plane land earlier, only later.
 * Version 2
 * Last modified: 11/15/11
 * Tested by: Kyle Martin
 * Date tested: 11/15/11
 */

enum Type{
	LANDING, TAKEOFF
};

public class Plane extends Event
{
	private int eventTime;  //Time that the plane should takeoff or land
	private int originalTime; //Original scheduled time
	private	Type eventType; //Taking off or landing;
	private int queueTime; //Time that the plane entered the queue.
	
	//Constructors
	public Plane(int time,Type type){
		eventTime = time;
		originalTime = time;
		eventType = type;
	}
	
	/**
	 * Author: Ben Lee
	 * Purpose: Sets the plane's scheduled time.
	 * Does not accept times earlier than originalTime
	 * Version 1
	 * Last modified: 11/15/11
	 * Tested by: Kyle Martin
	 * Date tested: 11/15/11
	 */
	public void setEventTime(int time){
		if(time < originalTime)
			eventTime = originalTime;
		else
			eventTime = time;
	}
	public void setEventType(Type type){
		eventType = type;
	}
	
	//Getter Methods:
	
	//Returns the time that the plane should take off or land
	public int getEventTime(){	
		return eventTime;
	}
	public Type getType(){	
		return eventType;
	}

	public void setQueueTime(int queueTime) {
		this.queueTime = queueTime;
	}

	public int getQueueTime() {
		return queueTime;
	}
}
